Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

276
Visualizações
Not working "serve" command for Vue js project

working with Laravel + Vue js. but when I try to start vue js using npm run serve command. it is en counting following error command in my cmd .

npm ERR! Missing script: "serve"
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR! npm run

how could I fix this problem?

package.json

{
    "private": true,
    "scripts": {
        "dev": "npm run development",
        "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
        "watch": "npm run development -- --watch",
        "watch-poll": "npm run watch -- --watch-poll",
        "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --disable-host-check --config=node_modules/laravel-mix/setup/webpack.config.js",
        "prod": "npm run production",
        "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
    "devDependencies": {
        "axios": "^0.24.0",
        "cross-env": "^7.0",
        "laravel-mix": "^6.0.39",
        "lodash": "^4.17.19",
        "resolve-url-loader": "^3.1.0",
        "sass": "^1.15.2",
        "sass-loader": "^8.0.0",
        "vue-template-compiler": "^2.6.14"
    },
    "dependencies": {
        "vue": "^2.6.14",
        "vue-axios": "^3.3.7",
        "vue-router": "^3.5.2",
        "vue-sweetalert2": "^5.0.2"
    }
}

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

This is not only vue js app. you are using vue with Laravel

If you want to create production build you have to run npm run prod. If you working local then you should use npm run watch. it will use hot reload so it will detect file changes and create complied filed.

Note : you have to add resourse js & css file to webpack.mix.js file and define the destination to store complied file in public folder.

You don't have to use npm run serve because you are using vue js in laravel.

about 4 years ago · Juan Pablo Isaza Relatório

0

Check if you have the below content inside the package.json, if not add it and then try running the commands

"scripts": {
    "serve": "vue-cli-service serve",
    "build": "vue-cli-service build",
    "lint": "vue-cli-service lint",
    // other commands
  },

Edit:

If you are using cmd in windows.

Follow the below steps

  1. Try deleting the node_modules folder and after that run npm i from the cmd.

  2. Then try running npm run serve again and see if it works this time

  3. if the above two steps don't work then install vue/cli service globally by running the command npm install @vue/cli-service -g and then follow step 1 and 2 sequentially

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda